package com.pic.gateway.config;

import org.springframework.stereotype.Component;
import org.springframework.util.AntPathMatcher;

import java.util.List;

@Component
public class PathFilterUtil {

    private final AntPathMatcher antPathMatcher = new AntPathMatcher();

    // 在这里添加需要排除的路径列表
    private final List<String> excludePaths = List.of("/user/login","/user/register", "/user/code/**","/public/**");

    public boolean shouldBypassFilter(String path) {
        for (String excludePath : excludePaths) {
            if (antPathMatcher.match(excludePath, path)) {
                return true;
            }
        }
        return false;
    }
}
